
import { Camera, color, Node, v2, Vec2, _decorator } from 'cc';

const { ccclass, property } = _decorator;

@ccclass('Const')
export class Const {
    // private static _instance: Const;
    // static get instance () {
    //     if (this._instance) {
    //         return this._instance;
    //     }T

    //     this._instance = new Const();
    //     return this._instance;
    // }

    // app打包版本号
    public static appBuildVersion = 0;
    // 热更新版本号
    public static hotupdateVersion = "0.0.0";

    public static gameName: string = "喵呜" //分享用的游戏名称

    public static isOnline: boolean = true //是否上线，上线后关闭日志
    public static isOpenCheat: boolean = false //是否开启作弊器
    public static isDebug: boolean = false //是否调试
    public static version: string = "1.0.9" //版本号 
    public static SaveHead: string = "JSF_" //修改标题头，可以刷新玩家数据
    public static camera3D: Node = null! //3D镜头
    public static cameraParam: number = null! //3D镜头系数
    public static isLow: boolean = true //是否是低端机

    public static CameraScene: Camera = null! //场景相机
    public static SceneNode: Node = null! //场景节点
    public static SceneBottom: Node = null! //场景底部
    public static ShadowParent: Node = null! //阴影的父节点
    public static ShadowWallParent: Node = null! //墙壁阴影的父节点
    public static GridParent: Node = null! //格子的父节点
    public static WallGridParent: Node = null! //墙的格子的父节点
    public static ItemParent: Node = null! //场景道具的父节点
    public static CarpetParent: Node = null! //场景地毯的父节点
    public static PendantParent: Node = null! //挂件的父节点
    public static WallFixedNode: Node = null! //墙体的父节点
    public static StreetFixedNode: Node = null! //街道的父节点
    public static FloorFixedNode: Node = null! //地板的父节点
    public static SelSceneNode: Node = null! //选择的场景节点
    public static GuestStartPos: Node = null! //客人起点位置，地铁口处
    public static LightParent: Node = null! //路灯的父节点
    public static IsShowOpsDialog: boolean = null! //是否显示操作界面
    public static isGodWealthShow: boolean = false // 是否显示财神了

    public static FloatStarParent: Node = null! //浮动星星父节点
    public static SelBuildingParent: Node = null! //操作按钮的父节点

    public static AllItems: Node[] = [] //房间内所有可以touch的点
    public static Guests: Node[] = [] //所有客人节点信息

    public static OriOffset: Vec2 = v2(0, 0) //原始偏移值
    public static MaxStreetX: number = 66 //街区最大x方向,右下角为x方向
    public static MaxStreetY: number = 23 //街区最大y方向
    public static MaxRoomX: number = 88 //88最大x方向，可根据房间解锁情况改变
    public static MaxRoomY: number = 88 //88最大y方向，可根据房间解锁情况改变
    public static MaxWallXRight: number = 24 //88*2最大x方向，可根据房间解锁情况改变
    public static MaxWallXLeft: number = -24 //88*2最大x方向，可根据房间解锁情况改变
    public static MaxWallY: number = 8 //8最大y方向，可根据房间解锁情况改变
    public static GuestSpeedTime: number = 0.66 //客人速度多少倍
    public static UICanvas: Node = null! //UI画布节点
    public static SceneOffsetX: number = 10000 //客人速度多少倍

    public static skillTitleColor: string[] = ['#74e530', '#30d1ff', '#ee51ff', '#ff8230'] //白，绿，蓝，紫，橙，红
    public static skillTitleColorOutline: string[] = ['#026900', '#003270', '#54015e', '#8f3710']  //白，绿，蓝，紫，橙，红

    public static weaponColorOutline: string[] = ['#6f6b54', '#0c5a1a', '#022867', '#4f0059', '#741602', '#6c100e'] //白色，绿色，蓝色，紫色，橙色，红色
    public static weaponColor: string[] = ['#e3dcb9', '#54d240', '#37bfff', '#d45afd', '#ff9437', '#fc3737'] //白色，绿色，蓝色，紫色，橙色，红色
    public static weaponHead: string[] = ['普通', '精良', '稀有', '史诗', '传说', '神话'] //属性列表
    public static weaponColorName: string[] = ['white', 'green', 'blue', 'purple', 'orange', 'red']

    public static bundles = ["json","fonts", "prefabs","textures", "audio", "animations","shaders"]


    public static GodWealthRefleshTime = 1  // 财神视频刷新次数
    public static LimitShopRefleshPrice = 0 //商店钻石刷新价格
    public static GodWealthReceiveOtherTime = 2  // 财神领取别人次数


    public static color = {
        white: color(255, 255, 255, 255),
        red: color(244, 0, 2, 255),
        gray: color(49, 49, 49, 255),
        lightGray: color(155, 155, 155, 225),
        black: color(0, 0, 0, 255),
    }

    public static ManagerTypes = {
        // 角色达到%d级
        roleLv: 1,
        // 发射任意发生器次数
        roomClickAdd: 2,
        // 完成订单数量
        taskDone: 3,
        // 解锁粉色手提包次数
        unlockPinkBag: 4,
        // 在棋盘合成次数
        composeCount: 5,
        // 为健身房建造次数
        buildCount: 6,
        // 消耗钻石购买能量次数
        diamondBuyPower: 7,
        // 在棋盘上出售任意物品次数
        roomSell: 8,
        // 加速发射器次数
        roomSpeedUp: 9,
        // 累计消耗能量数量
        powerCost: 10,
        // 合成最高等级金币个数
        composeCoinMaxLv: 11,
        // 合成最高等级能量球个数
        composePowerMaxLv: 12,
        // 累计消耗金币数量
        coinCost: 13,
    };

    public static CacheDataKey = {
        music: "music",
        sound: "sound",
    }

    public static DataKeys = {
        isInitData: "isInitData", //是否初始化过数据
        roleLv: "roleLv", // 玩家等级
        roleName: "roleName", // 玩家名字
        roleID: "roleID", // 玩家ID
        roleAvatar: "roleAvatar", // 玩家头像


        roleExp: "roleExp", // 玩家经验
        coin: "coin", // 金币
        diamonds: "diamonds", // 钻石
        power: "power", //体力

        tujianProp: "tujianProp",  // 图鉴道具
        tujianScene: "tujianScene",  // 图鉴道具

        growUp: "growUp",  // 图鉴道具
        warehouseProp: "warehouseProp", // 仓库道具


        sceneHead: "sceneHead_", //场景存储的头部信息
        sceneItem: "sceneHead_item_", //场景道具类型存储
        sceneCarpet: "sceneHead_carpet_", //场景地垫数据
        scenePendant: "sceneHead_pendant_", //场景挂件数据
        sceneWall: "sceneHead_wall_", //场景墙体
        sceneFloor: "sceneHead_floor_", //场景地板

        // 跨天保存时间点
        saveDayTime: "saveDayTime",

        // 战令积分
        seasonScore: "seasonScore",
        // 战令id
        seasonId: "seasonId",
        // 战令对应id奖励情况
        seasonAwardInfo: "seasonAwardInfo_",
        // 战令解锁
        seasonOpen: "seasonOpen",

        // 主线棋盘数据
        composeRoomData: "composeRoomData",
        // 主线任务列表
        composeTaskArr: "composeTaskArr",
        // 店长值班日
        composeManagerArr: "composeManagerArr",
        // 是否是已经全部完成店长值班日
        composeManagerAllGet: "composeManagerAllGet",
        // 卡片列表
        composeCardArr: "composeCardArr",
        // 合成UI道具获得次数标记
        composePropCount: "composePropCount_",
        // 无限能量时间
        composePowerTime: "composePowerTime",

        // 新手教程-强引导索引
        handIndex: "handIndex",

        sceneSkinIsGotted: "sceneSkinIsGotted_", //+皮肤表ID，场景里的皮肤是否获得，0未获得，1获得，
        sceneRoomIsUnlock: "sceneRoomIsUnlock_", //+房间ID，场景里的房间是否解锁，0未解锁，1解锁，
        sceneRoomIsUnReceive: "sceneRoomIsUnReceive_", //+房间ID，场景里的房间是否已领取，0 、1，

        dailyTime: "dailyTime",
        buyPowerTime: "buyPowerTime1",

        greenStar: "greenStar",
        dressMoney: "dressMoney",
        dressValue: "dressValue",

        isVip: "isVip",
        roleDressUpId: "roleDressUpId",

        timeCD: "timeCD",

        propBuyTime: "propBuyTime",

        emailList: "emailList",

        newEmailIDs: "newEmailIDs",

        signdayReceive: "signdayReceive",

        signdaytime: "signdaytime",

        GodWealthData: "GodWealthData",

        authSetting: "authSetting",

        TaskLineStep: "TaskLineStep",
        TaskLineFinsh: "TaskLineFinsh",
        TaskLineFinshReward: "TaskLineFinshReward",


    }

    public static MoneyKeys = {
        MoneyVip: "Money_Vip",
        FirstCharge: "Money_FirstCharge",
        MonthCharge: "Money_MonthCharge",
        WeekCharge: "Money_WeekCharge",

    }

    public static Tables = {
        scene_item: "scene_item", //场景道具表
        scene_skin: "scene_skin", //场景道具皮肤表
        scene_room: "scene_room", //场景房间表
        scene_guest: "scene_guest", //场景客人表
        scene_guest_ani: "scene_guest_ani", //场景客人动画表
        const: "const", //全局常量表
        ui: "ui_table", //ui文字表
        draw: "draw_table", //ui文字表
        resTable: "res_table", //ui文字表

        // 道具表
        prop: "prop_prop",
        // 合成额外奖励
        composeAward: "prop_composeAward",
        // 背包扩容
        bagGrid: "prop_bagGrid",
        // 订单生成表
        taskType: "task_orderType",

        taskMainType: "taskMain_orderType",
        taskUnlock: "taskMain_taskUnlock",

        // 店长值日表
        manager: "task_manager",
        // 棋盘初始化
        composeRoomInit: "prop_new",
        // 新手引导任务
        handTask: "task_newTask",
        // 保底任务
        leastTask: "task_SafeTask",
        // 战令
        seasonAward: "task_seasonAward",
        // 福袋
        fuBag: "prop_FuBag",

        // 机器人-棋盘初始化
        composeRoomInitRobot: "robot_robotCompose",

        herolevel: "herolevel_table", //角色等级表

        setting: "setting_table", //debug表

        shopTable: "shop_shop",
        recharge: "recharge_recharge",
        privilege: "privilege_table",

        giftFree: "shop_giftFree",

        task_growUp: "task_growUp",

        sign: "sign_sign",


        roleDressUp: "Change_change",

        language: "language_table",
        saleShop: "saleshop_shop",
        saleShopItem: "saleshop_item",

        saleshop_totalRecharge: "saleshop_totalRecharge",
        saleshop_RechargeReward: "saleshop_RechargeReward",
        lockActivity_item: "lockActivity_item",

    }

    public static Shaders = {
        shineColor: 'shaders|shineColor',
    }


    //所有对话框加载的地址
    public static Dialogs = {
        //充值有关的
        gold_gift: 'prefabs|recharge/gold_gift',
        diamond_gift: 'prefabs|recharge/diamond_gift',
        tick_no_enough: 'prefabs|recharge/tick_no_enough',
        first_charge_gift: "prefabs|recharge/first_charge_gift",
        month_card: "prefabs|recharge/month_card",
        daily_deal: "prefabs|recharge/daily_deal",
        gift_reward: "prefabs|recharge/gift_reward",
        total_recharge: "prefabs|recharge/total_recharge",

        //建筑切换界面
        scene_skin: 'prefabs|scene/scene_skin',
        scene_skin_detail: 'prefabs|scene/scene_skin_detail',
        scene_skin_detail_list: 'prefabs|scene/scene_skin_detail_list',

        build_list: 'prefabs|buildList/build_list', //建造清单列表
        build_region_unlock: 'prefabs|buildRegion/build_region_unlock', //提示建造的界面
        build_list_region_info: 'prefabs|buildList/build_list_region_info', //提示建造的界面


        reward_item: "prefabs|items/reward_item",
        
        //装扮切换界面
        role_dress_up: 'prefabs|setting/role_dress_up',
        role_info: 'prefabs|setting/role_info',

        // 超级会员界面
        svip_gift_2: 'prefabs|svipGift/svip_gift_2',  //没用上
        svip_gift: 'prefabs|svipGift/svip_gift',
        svip_info: 'prefabs|svipGift/svip_info',
        svip_buy: 'prefabs|svipGift/svip_buy',

        // 财神有关的
        god_wealth_gift_take: 'prefabs|godWealth/god_wealth_gift_take',
        fu_bag_open: 'prefabs|godWealth/fu_bag_open',
        fu_bag_take: 'prefabs|godWealth/fu_bag_take',
        god_wealth_gift_choose: 'prefabs|godWealth/god_wealth_gift_choose',   //没用上

        // 合成游戏界面
        item_compose_game: 'prefabs|composeGame/item_compose_game',
        more_game: 'prefabs|composeGame/more_game',     //没用上     
        main_interface_middle: 'prefabs|mainInterface/main_interface_middle', 
        fly_tip: 'prefabs|notice/fly_tip',
        notice: 'prefabs|notice/notice', 
        level_up: 'prefabs|composeGame/level_up',
        gm_input: 'prefabs|gm/gm_input',
        // 背包界面
        backpack: 'prefabs|composeGame/backpack',
        // 值班日界面
        store_manager_duty_day: 'prefabs|composeGame/store_manager_duty_day',
        // 新手教程界面
        beginner_tutorial: 'prefabs|composeGame/beginner_tutorial',
        // 获得新物品
        new_item_compose: 'prefabs|composeGame/new_item_compose',
        // 道具详情页
        item_detail: 'prefabs|composeGame/item_detail',
        // 订单列表
        order_list: 'prefabs|composeGame/order_list',
        // 新角色
        new_guest_take: 'prefabs|composeGame/new_guest_take',      //没用上

        //图鉴
        illustrated_handbook: "prefabs|illustratedHandbook/illustrated_handbook",

        treasure_chest: 'prefabs|composeGame/treasure_chest',
        item_Info: "prefabs|items/item_Info",
        power_buy: "prefabs|mainInterface/power_buy",
        
        //商店
        shop: "prefabs|shop/shop",

        //调试
        debug: "prefabs|gm/debug",
        shop_backups: "prefabs|shop/shop_backups",      //没用上  

        //设置
        setting: "prefabs|setting/setting",
        code_exchange: "prefabs|setting/code_exchange",

        reward: "prefabs|notice/reward",
        free_gift: "prefabs|freeGift/free_gift",
        free_buy: "prefabs|mainInterface/free_buy",

        sign: "prefabs|sign/sign",

        grow_up_fund: "prefabs|recharge/grow_up_fund",

        //邮件
        mailbox: "prefabs|mailbox/mailbox",
        email_info: "prefabs|mailbox/email_info",

        //npc档案
        guest_files: "prefabs|gusetFiles/guest_files",
        guest_info: "prefabs|gusetFiles/guest_info",

        nickname_modify: "prefabs|setting/nickname_modify",

        item_reflesh: "prefabs|shop/item_reflesh",

        //阿宝的货车
        treasure: "prefabs|shop/treasure",
        treasure_finish: "prefabs|shop/treasure_finish",

        privacy_agreement: "prefabs|setting/privacy_agreement",

    }

    public static resPath = {
        
        //animations
        roleSpine: "animations|role/",
        defaultGuestSpine: "animations|role/", //默认场景客人
        composeSpine: "animations|composeSpine/",// 合成模块spine动画目录





        //textures
        icon: "",
        roleIcon: "textures|role/",
        freeGiftIcon: "textures|freeGift/",
        defaultSceneIcons: "textures|optionalSceneItem/", //默认场景图标
        tujian: "textures|illustratedHandbook/",
        composeIcon: "textures|composeGame/",

    
        icon_diamons: "textures|common/icon_diamond",
        icon_coin: "textures|common/icon_coin",
        icon_video: "textures|common/icon_video_green",
        buildpicture: "textures|buildList/",
        common: "textures|common/",

        //prefabs
        defaultScenePrefabs: 'prefabs|optionalSceneItem/', //默认场景预制体
        
        
        
        

    }

    //预制体加载
    public static Prefabs = {

        //UI-主界面
        main_interface_top: 'prefabs|mainInterface/main_interface_top',
        fly_tip_item: 'prefabs|notice/fly_tip_item',
        build_list_region: 'prefabs|buildList/build_list_region', //建筑清单的选项
        reward_item: 'prefabs|Items/reward_item', //跳出的资源小框
        float_star: 'prefabs|buildRegion/float_star', //家具上面飘着的星星
        flash_star: 'prefabs|specialEffects/flash_star', //闪烁的星星
        scene_outdoor: 'prefabs|scene/scene_outdoor',
        grid: 'prefabs|scene/grid',
        grid_wall: 'prefabs|scene/grid_wall',
        scene_ops: 'prefabs|scene/scene_ops',
        scene_arrow: 'prefabs|scene/scene_arrow',
        store_skin_item: 'prefabs|scene/store_skin_item', //装扮选项
        guest: 'prefabs|scene/guest',

        item: "prefabs|items/item",
        btn_get: "prefabs|items/btn_get",
        first_charge_buy: "prefabs|recharge/first_charge_buy",
        shop_synthesis_item: "prefabs|recharge/diamond_bug",

        get_animal_layer: "prefabs|specialEffects/get_animal_layer",

        red_point: "prefabs|notice/red_point",
        guest_label: "prefabs|gusetFiles/guest_label",


    }

    public static Audio = {
        bgm: 'audio|bgm',
        btn: 'audio|btn',
        //thunder: 'audio|thunder',
        //show_ten: 'audio|show_ten',
        //electric: 'audio|electric',
        //ten_prompt2: 'audio|ten_prompt2',
        //ten_summon: 'audio|ten_summon',
        //num: 'audio|num',
        flash_show: 'audio|flash_show',
        star_touch: 'audio|star_touch',

        sell_back: 'audio|sell_back',
        bubble: 'audio|bubble',
        bubble_bomb: 'audio|bubble_bomb',
        scene_change: 'audio|scene_change',
        create_prop: 'audio|create_prop',
        task_done: 'audio|task_done',
        click_coin: 'audio|click_coin',
        compose: 'audio|compose',

        //ack: 'd2audio|ack',
        //aim: 'd2audio|aim',
        //card: 'd2audio|card',
        //fireball: 'd2audio|fireball',
        //foot: 'd2audio|foot',
        //getGold: 'd2audio|getGold',
        //gold_drop1: 'd2audio|gold_drop1',
        //hBone: 'd2audio|hBone',
        //hGhost: 'd2audio|hGhost',
        //hit: 'd2audio|hit',
        //hMeat: 'd2audio|hMeat',
        //hStone: 'd2audio|hStone',
        //hWood: 'd2audio|hWood',
        //ice: 'd2audio|ice',
        //laser: 'd2audio|laser',
        //lose: 'd2audio|lose',
        //over_card: 'd2audio|over_card',
        //prompt: 'd2audio|prompt',
        //show_up: 'd2audio|show_up',
        //skill_show: 'd2audio|skill_show',
        //summon: 'd2audio|summon',
        //uplv: 'd2audio|uplv',
        //upstar: 'd2audio|upstar',
        //open_box: 'd2audio|open_box',

        //absorb: 'd2audio|absorb',
        //collect: 'd2audio|collect',
        //land: 'd2audio|land',
        //sweep: 'd2audio|sweep',
        //win: 'd2audio|win',
        //wind: 'd2audio|wind',
    }

    public static config = {
        basicGold: 'basicGold',
        basicDiamons: 'basicGem',
        basicDress: 'basicDress',
        basicDressMoney: 'basicDressMoney',
        basicGreenStar: 'basicGreenStar',

        energyMax: "energyMax",
        freePower: "freePower",
        diamonsPower: "diamonsPower",
        CardAddPower: "CardAddPower",
    }

    //声音的长度统计，用于并发控制，单位毫秒
    public static AudioCnt: number = 6
    public static AudioTime: { [key: string]: number } = {
        "alarm": 4640,
        "summon": 2063,
    }

}
